#include <Arduino.h>

#include <ESP32Encoder.h>

#include "main.h"

//UI
#include "my_ui\myGUI.h"
#include "my_ui\demo.h"
#include "my_ui\demo1.h"
#include "my_ui\demo2.h"
//驱动
#include "dev_port\dsp_dev.h"
#include "dev_port\in_dev.h"

ESP32Encoder encoder;

void setup(){

	Serial.begin(115200);

	ESP32Encoder::useInternalWeakPullResistors=UP;
	encoder.attachSingleEdge(EC11_A_PIN, EC11_B_PIN);
	encoder.setCount(3);

	//LVGL初始化
	lv_init();
	//屏幕驱动
	lv_port_disp_init();
	//输入驱动
	// lv_port_indev_init();

	//lv_ex_tabview_1();

	lv_demo_widgets();//官方demo
	// lv_ex_gauge_1();//官方demo1
	//lv_ex_tileview_1();//官方demo2
}

void loop(){
	// Loop and read the count
	Serial.println("Encoder count = " + String((int32_t)encoder.getCount()));
	delay(20);

	lv_task_handler(); /* let the GUI do its work */
	delay(5);
}

